package com.cskaoyan.controller.wx.brand;

import com.cskaoyan.bean.MarketBrand;
import com.cskaoyan.bean.common.BasePageInfo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.vo.admin.brand.BrandListVo;
import com.cskaoyan.service.wx.brand.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author erdonc
 * @description: TODO 品牌模块
 * @date 2022/9/11 14:36
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {

    @Autowired
    WxBrandService wxBrandService;


    /**
     * @Author: erdonc
     * @date : 2022/9/11 14:48
     * TODO: 展示品牌商列表
     * Request URL: http://182.92.235.201:8083/wx/brand/list?page=1&limit=10
     */
    @RequestMapping("list")
    public BaseRespVo list(BasePageInfo pageInfo) {
        CommonData<MarketBrand> bandList = wxBrandService.list(pageInfo);
        return BaseRespVo.ok(bandList);
    }


    /**
     * @Author: erdonc
     * @date : 2022/9/11 15:29
     * TODO: 获取品牌详情页
     * Request URL: http://182.92.235.201:8083/wx/brand/detail?id=1024000
     */
    @RequestMapping("detail")
    public BaseRespVo detail(Integer id) {
        MarketBrand details = wxBrandService.detail(id);
        return BaseRespVo.ok(details);
    }
}
